<template>
  <el-pagination
    class="pagination"
    :hide-on-single-page="false"
    :current-page="currentPage"
    :page-sizes="pageSizes"
    :page-size="pageSize"
    :layout="layout"
    :total="total"
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
  />
</template>

<script>
export default {
  props: {
    currentPage: {
      type: Number,
      default: 1
    },
    pageSize: {
      type: Number,
      default: 10
    },
    total: {
      type: Number,
      default: 0
    },
    layout: {
      type: String,
      default: 'total, sizes, prev, pager, next, jumper'
    },
    pageSizes: {
      type: Array,
      default: () => [1, 10, 30, 50, 100]
    }
  },
  data() {
    return {}
  },
  methods: {
    handleSizeChange(size) {
      this.$emit('sizeChange', size)
    },
    handleCurrentChange(page) {
      this.$emit('currentChange', page)
    }
  }
}
</script>

<style lang="scss" scoped>
.pagination {
  margin-top: 16px;
}
</style>
